import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import vue3TreeOrg from "vue3-tree-org"; // 引入vue3-tree-org, 用于组织架构图
import "vue3-tree-org/lib/vue3-tree-org.css"; // 引入vue3-tree-org样式
import "./common/utils/flexible";
import "normalize.css"; // 各浏览器样式兼容
import "animate.css/animate.min.css";
// 路由前置守卫
import "./permission";
// elem相关引用
import ElementPlus from "element-plus";
// plus版本都是英文，引入这个中文包，组件使用才能是中文模式，比如选择日期等...
import zhCn from "element-plus/es/locale/lang/zh-cn";
import "@/common/styles/base.scss";
import "@/styles/index.scss";
// 自定义指令
import directives from "@/directives/index";

import "@/common/styles/base.scss";
// import PDFObjectPlugin from "pdfobject-vue";
import {
  // 全局引入通用的组件，其他组件各自引用
  ElButton,
  ElInput,
} from "element-plus";

export const app = createApp(App); // 生成 Vue 实例 app
app.use(ElementPlus, {
  locale: zhCn,
});
app.use(router); // 引用路由实例
app.use(store); // 引用vuex实例
app.use(vue3TreeOrg); // 引用vue3-tree-org, 用于组织架构图
app.use(directives); // 全局注册指令
// app.use(PDFObjectPlugin);
// 全局注册svg-icon组件
import "@/icons/index";
import SvgIcon from "@/components/SvgIcon";

app.component("svg-icon", SvgIcon);
app.mount("#app"); // 挂载到 #app
